@echo off
REM --- 检查管理员权限 ---
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo 正在请求管理员权限...
    powershell -Command "Start-Process '%~0' -Verb RunAs"
    exit /b
)

REM --- 禁用内存完整性（内核隔离核心功能）---
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 0 /f

REM --- 关闭虚拟化平台功能（依赖Hyper-V）---
dism /online /disable-feature /featurename:VirtualMachinePlatform /norestart

REM --- 禁用Hyper-V启动项 ---
bcdedit /set hypervisorlaunchtype off

echo 操作完成！必须重启系统生效。
echo.
pause
shutdown /r /t 60
